package com.ruoyi.front.service.impl;
import com.ruoyi.business.domain.BusinessLeave;
import com.ruoyi.business.domain.StatisticsDept;
import com.ruoyi.business.domain.StatisticsLeaveEveryday;
import com.ruoyi.front.mapper.FrontLeaveMapper;
import com.ruoyi.front.mapper.FrontStatisticsMapper;
import com.ruoyi.front.service.IFrontStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class FrontStatisticsServiceImpl implements IFrontStatisticsService {
    @Autowired
    private FrontStatisticsMapper frontStatisticsMapper;
    @Override
    public List<StatisticsDept> selectStatisticsDeptList() {
        return frontStatisticsMapper.selectStatisticsDeptList();
    }

        @Override
        public List<StatisticsLeaveEveryday> selectLeaveData(int startYear) {
            // 构建日期范围
            String startDate = startYear + "-01-01";
            String endDate = startYear + "-12-31";

            // 查询数据库
            return frontStatisticsMapper.findByDateBetween(startDate, endDate);
        }
    }

